#define _CRT_SECURE_NO_WARNINGS	

#include<stdio.h>

int judge(int x)
{
    int sum = 0;
    if (x == 1)
        return 0;
    for (int i = 1; i < x; i++)
    {
        if (x % i == 0)
            sum += i;
    }
    if (sum > x)
        return 1;
    else if (sum < x)
        return 2;
    else
        return 0;
}


int main()
{
    int a, b;
    scanf("%d%d", &a, &b);
    int x = 0, y = 0, z = 0;
    for (int i = a; i <= b; i++)
    {
        if (judge(i) == 1)
            x++;
        else if (judge(i) == 2)
            y++;
        else z++;
    }
    printf("profit : %d\nloss : %d\nperfect : %d\n", x, y, z);
    return 0;
}